/*
	The entrain of the app.
*/
#include "include\hge.h"
#include <Windows.h>
#include "Render.h"
#include "Frame.h"

//Global variables.
extern HGE* gHge;

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
	// Get HGE interface
	gHge = hgeCreate(HGE_VERSION);

	// Set up log file, frame function, render function and window title
	gHge->System_SetState(HGE_LOGFILE, "bubbles.log");
	gHge->System_SetState(HGE_FRAMEFUNC, FrameFunc);
	gHge->System_SetState(HGE_RENDERFUNC, RenderFunc);
	gHge->System_SetState(HGE_TITLE, "BUBBLES");

	// Set up video mode
	gHge->System_SetState(HGE_WINDOWED, false);
	//gHge->System_SetState(HGE_SCREENWIDTH, 800);
	//gHge->System_SetState(HGE_SCREENHEIGHT, 600);
	gHge->System_SetState(HGE_SCREENBPP, 32);
	if(gHge->System_Initiate())
	{
		// Let's rock now!
		gHge->System_Start();
	}

	// Clean up and shutdown
	gHge->System_Shutdown();
	gHge->Release();
	return 0;
}
